
local class = require("Utils.ClassUtils").class

---@class EquipmentController
---@field new fun(): EquipmentController
-- 定义一个合成Controller类

local EquipmentController = class("EquipmentController")



-- 消耗装备的方法
-- @param role: 要消耗装备的角色
-- @param equipment_key: 要消耗的装备key
-- @param consume_num: 要消耗的数量
function EquipmentController:consume_equipment(role, equipment_key, consume_num)
    -- 获取角色的EquipmentComp组件
    -- local equipment_comp = role.get_equipment_comp()
    print("消耗装备")
    print(role)
    role.consume_equipment(equipment_key, consume_num)
    -- print(equipment_comp)
    -- -- 检查角色是否有该装备
    -- if equipment_comp and equipment_comp.has_equipment(equipment_key) then
    --     -- 消耗装备
    --     equipment_comp.consume_equipment(equipment_key, consume_num)
    --     return true
    -- else
    --     -- 角色没有该装备
    --     return false
    -- end
end



return EquipmentController